// MESSAGE KALMAN_DATA_X support class

#pragma once

namespace mavlink {
namespace fppa {
namespace msg {

/**
 * @brief KALMAN_DATA_X message
 *
 * KALMAN_DATA_X
 */
struct KALMAN_DATA_X : mavlink::Message {
    static constexpr msgid_t MSG_ID = 22;
    static constexpr size_t LENGTH = 208;
    static constexpr size_t MIN_LENGTH = 208;
    static constexpr uint8_t CRC_EXTRA = 107;
    static constexpr auto NAME = "KALMAN_DATA_X";


    std::array<float, 13> xk1; /*<  state prediction */
    std::array<float, 13> xk0; /*<  state fusion */
    std::array<float, 13> delta_xk; /*<  state deviation */
    std::array<float, 13> Q; /*<  state noise */


    inline std::string get_name(void) const override
    {
            return NAME;
    }

    inline Info get_message_info(void) const override
    {
            return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
    }

    inline std::string to_yaml(void) const override
    {
        std::stringstream ss;

        ss << NAME << ":" << std::endl;
        ss << "  xk1: [" << to_string(xk1) << "]" << std::endl;
        ss << "  xk0: [" << to_string(xk0) << "]" << std::endl;
        ss << "  delta_xk: [" << to_string(delta_xk) << "]" << std::endl;
        ss << "  Q: [" << to_string(Q) << "]" << std::endl;

        return ss.str();
    }

    inline void serialize(mavlink::MsgMap &map) const override
    {
        map.reset(MSG_ID, LENGTH);

        map << xk1;                           // offset: 0
        map << xk0;                           // offset: 52
        map << delta_xk;                      // offset: 104
        map << Q;                             // offset: 156
    }

    inline void deserialize(mavlink::MsgMap &map) override
    {
        map >> xk1;                           // offset: 0
        map >> xk0;                           // offset: 52
        map >> delta_xk;                      // offset: 104
        map >> Q;                             // offset: 156
    }
};

} // namespace msg
} // namespace fppa
} // namespace mavlink
